<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        html{
         font-size: 12px;
        }
        /* 1rem等于一个字体大小，取决于html设置的字体大小*/
        .box1{
         width: 10rem;
         height: 10rem;
         background-color: rgb(144, 91, 91);
        }
        /* 媒体查询  screen屏幕*/
       @media (width:375px) {
       .box1{
         background-color: rgb(255, 49, 49);
       }
       }
       @media (width:414px) {
        .box1{
         background-color: rgb(11, 59, 121);
        }
       }
    </style>
</head>
<body>
    <div class="box1"></div>
    <div class="box2"></div>
</body>
</html>